package com.fanbo.impl;

import com.fanbo.HelloService;
import java.util.Random;
import org.apache.dubbo.config.annotation.Service;

@Service
public class HelloServiceImpl implements HelloService {

  @Override
  public String sayHello(String name) {
    return "hello"+name;
  }

  @Override
  public String methodA() {
     sleepRandom();
     return "methodA";
  }

  @Override
  public String methodB() {
    sleepRandom();
    return "methodB";
  }

  @Override
  public String methodC() {
    sleepRandom();
    return "methodC";
  }

  private void sleepRandom(){
    Random random = new Random();
    int sleepTime = random.nextInt(100);
    try{
      Thread.sleep(sleepTime);
    }catch (InterruptedException e){
      e.printStackTrace();
    }

  }
}
